import InputControlService from '../input/service';

class ModelNameService extends InputControlService {

  constructor(){
    super({ label: '流程名称', field: 'name' });
  }

  onChange(val: string) {

    // 并不是真实的值
    this.value = val;

    const element = this.root.getProcessElement();
    if(!element) throw Error('流程名称不存在');
    this.root.getModeling().updateProperties(
      element,
      {
        name: val,
      },
    );
  }

}

export default ModelNameService;
